local hx__benlie = fk.CreateSkill {
  name = "hx__benlie",
}

hx__benlie:addEffect(fk.AfterCardsMove, {
  anim_type = "offensive",
  can_trigger = function(self, event, target, player, data)
    if player:hasSkill(hx__benlie.name) then
      if event == fk.AfterCardsMove then
        local room = player.room
        for _, move in ipairs(data) do
          if move.to == player and move.toArea == Card.PlayerHand then
            for _, info in ipairs(move.moveInfo) do
              local id = info.cardId
              if room:getCardArea(id) == Card.PlayerHand and room:getCardOwner(id) == player then
                return table.find(player:getCardIds("h"), function(car)
                  return Fk:getCardById(car).is_damage_card
                end)
              end
            end
          end
        end
      end
    end
  end,
  on_use = function(self, event, target, player, data)
    local room = player.room
    local cards = table.filter(player:getCardIds("h"), function(car)
      return Fk:getCardById(car).is_damage_card
    end)
    if #cards > 0 then
      room:askToUseRealCard(player,{
        pattern = cards,
        skill_name = hx__benlie.name,
        extra_data = {
          bypass_times = false,
          extraUse = false,
        },
        cancelable = false,
      })
    end
  end,
})


return hx__benlie